package smdc.order.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import smdc.common.utils.DateUtils;
import smdc.order.domain.DishDetail;
import smdc.order.mapper.DishDetailMapper;
import smdc.order.service.IDishDetailService;

/**
 * 菜品规格详情Service业务层处理
 * 
 * @author maorui
 * @date 2025-03-28
 */
@Service
public class DishDetailServiceImpl implements IDishDetailService 
{
    @Autowired
    private DishDetailMapper dishDetailMapper;

    /**
     * 查询菜品规格详情
     * 
     * @param detailId 菜品规格详情主键
     * @return 菜品规格详情
     */
    @Override
    public DishDetail selectDishDetailByDetailId(Long detailId)
    {
        return dishDetailMapper.selectDishDetailByDetailId(detailId);
    }

    /**
     * 查询菜品规格详情列表
     * 
     * @param dishDetail 菜品规格详情
     * @return 菜品规格详情
     */
    @Override
    public List<DishDetail> selectDishDetailList(DishDetail dishDetail)
    {
        return dishDetailMapper.selectDishDetailList(dishDetail);
    }

    /**
     * 新增菜品规格详情
     * 
     * @param dishDetail 菜品规格详情
     * @return 结果
     */
    @Override
    public int insertDishDetail(DishDetail dishDetail)
    {
        dishDetail.setCreateTime(DateUtils.getNowDate());
        return dishDetailMapper.insertDishDetail(dishDetail);
    }

    /**
     * 修改菜品规格详情
     * 
     * @param dishDetail 菜品规格详情
     * @return 结果
     */
    @Override
    public int updateDishDetail(DishDetail dishDetail)
    {
        return dishDetailMapper.updateDishDetail(dishDetail);
    }

    /**
     * 批量删除菜品规格详情
     * 
     * @param detailIds 需要删除的菜品规格详情主键
     * @return 结果
     */
    @Override
    public int deleteDishDetailByDetailIds(Long[] detailIds)
    {
        return dishDetailMapper.deleteDishDetailByDetailIds(detailIds);
    }

    /**
     * 删除菜品规格详情信息
     * 
     * @param detailId 菜品规格详情主键
     * @return 结果
     */
    @Override
    public int deleteDishDetailByDetailId(Long detailId)
    {
        return dishDetailMapper.deleteDishDetailByDetailId(detailId);
    }
}
